import {baseUrl,apiA,apiHomAvater,apiBanner,apiHomMeun,apiHomBlogType,apiAList,api} from "../config"
import {fetch_get} from './index'
export async function getMeun(){

    const result = await fetch_get(baseUrl+apiHomMeun);

    return result;

}
export async function getAvater(){
    const result = await fetch_get(baseUrl+apiHomAvater);

    return result;
}


export async function getBlogType(){

    const result =await fetch_get(baseUrl+apiHomBlogType);

    return result;
}

export async function getBlogList(type,skip = 1,limit= 10){

    const result = await fetch_get(`${baseUrl}${apiAList}/${type}?limit=${limit}&skip=${skip}`);
    
    return result.data;

}
export async function getBlogDetalis(_id){
    const result = await fetch_get(`${baseUrl}${apiA}/${_id}`);

    return result.data;
}
export async function getBanner(){

    const result = await fetch_get(`${baseUrl}${apiBanner}`);

    return result.data;

}
 
